﻿// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Oliver Rau" email="mail@olira.de"/>
//     <version>$Revision: 9 $</version>
//     <created>12.08.2006 19:11</created>
// </file>

using System;
using System.Collections.Generic;

namespace ns2kml
{
	/// <summary>
	/// Description of APInfo.
	/// </summary>
	public class APInfo
	{
		string ssid;
		string bssid;
		int maxSignal;
		int minNoise;
		int maxSnr;
		WifiFlag flags;
		uint beaconInterval;
		DateTime firstSeen;
		DateTime lastSeen;
		GeoPoint bestPosition;
		
		List<APData> apData;
		string name;
		ulong channels;
		uint lastChannel;
		string ipAddress;
		int minSignal;
		int maxNoise;
		uint dataRate;
		string ipSubnet;
		string ipMask;
		uint apFlags;
		byte[] informationElements;
		
		public APInfo()
		{
			bestPosition = new GeoPoint();
		}
		
		public bool HasFlag(WifiFlag flag)
		{
			return (flags & flag) == flag;
		}
		
		#region Getters / Setters
		public string SSID {
			get {
				if (ssid == null || ssid == "")
					return "[empty]";
				
				return ssid;
			}
			set {
				ssid = value;
			}
		}
		
		public string BSSID {
			get {
				return bssid;
			}
			set {
				bssid = value;
			}
		}
		
		public int MaxSignal {
			get {
				return maxSignal;
			}
			set {
				maxSignal = value;
			}
		}
		
		public int MinNoise {
			get {
				return minNoise;
			}
			set {
				minNoise = value;
			}
		}
		
		public int MaxSNR {
			get {
				return maxSnr;
			}
			set {
				maxSnr = value;
			}
		}
		
		public WifiFlag Flags {
			get {
				return flags;
			}
			set {
				flags = value;
			}
		}
		
		public uint BeaconInterval {
			get {
				return beaconInterval;
			}
			set {
				beaconInterval = value;
			}
		}
		
		public DateTime FirstSeen {
			get {
				return firstSeen;
			}
			set {
				firstSeen = value;
			}
		}
		
		public DateTime LastSeen {
			get {
				return lastSeen;
			}
			set {
				lastSeen = value;
			}
		}
		
		public GeoPoint BestPosition {
			get {
				return bestPosition;
			}
			set {
				bestPosition = value;
			}
		}
		
		public List<APData> APData {
			get {
				return apData;
			}
			set {
				apData = value;
			}
		}
		
		public string Name {
			get {
				return name;
			}
			set {
				name = value;
			}
		}
		
		public ulong Channels {
			get {
				return channels;
			}
			set {
				channels = value;
			}
		}
		
		public uint LastChannel {
			get {
				return lastChannel;
			}
			set {
				lastChannel = value;
			}
		}
		
		public string IpAddress {
			get {
				return ipAddress;
			}
			set {
				ipAddress = value;
			}
		}
		
		public int MinSignal {
			get {
				return minSignal;
			}
			set {
				minSignal = value;
			}
		}
		
		public int MaxNoise {
			get {
				return maxNoise;
			}
			set {
				maxNoise = value;
			}
		}
		
		public uint DataRate {
			get {
				return dataRate;
			}
			set {
				dataRate = value;
			}
		}
		
		public string IpSubnet {
			get {
				return ipSubnet;
			}
			set {
				ipSubnet = value;
			}
		}
		
		public string IpMask {
			get {
				return ipMask;
			}
			set {
				ipMask = value;
			}
		}
		
		public uint ApFlags {
			get {
				return apFlags;
			}
			set {
				apFlags = value;
			}
		}
		
		public byte[] InformationElements {
			get {
				return informationElements;
			}
			set {
				informationElements = value;
			}
		}
		
		#endregion
	}
}
